const state = {
  nameList: []
}

const actions = {

}

const getters = {
    nameList: name => name.nameList
}

const mutations = {
    cacheName(state, value){
      let Repeat = state.nameList.indexOf(value)
      if (Repeat !== -1) {
        state.nameList.splice(Repeat, 1)
      }
      if (state.nameList.length >= 10) {
        state.nameList.splice(9, 10)
      }
      state.nameList.unshift(value)
    }
}

export default {
    state,
    actions,
    getters,
    mutations
}
